//
//  QDetailsOrderMapCell.m
//  QoilPublic
//
//  Created by 杨凯 on 16/7/19.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import "QDetailsOrderMapCell.h"

@interface QDetailsOrderMapCell()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;

@end
@implementation QDetailsOrderMapCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setSeparatorInset:UIEdgeInsetsZero];
    [self setLayoutMargins:UIEdgeInsetsZero];}

- (void)setIndexPath:(NSIndexPath *)indexPath{

    _indexPath = indexPath;
    _subTitleLabel.textColor = [QColorUtility defaultBackColor];
    if(_indexPath.section == 0){
        if(_indexPath.row == 0){
            _titleLabel.text = @"下单金额";
        }else if (_indexPath.row == 1){
            _titleLabel.text = @"加油单价";
        }else if (_indexPath.row == 2){
            _titleLabel.text = @"柴油标准";
        }else if (_indexPath.row == 3){
            _titleLabel.text = @"加油时间";
        }else if (_indexPath.row == 4){
            _titleLabel.text = @"加油地点";
        }else if (_indexPath.row == 5){
            _titleLabel.text = @"联系方式";
        }else if (_indexPath.row == 6){
            _titleLabel.text = @"需要发票";
        }
    }else if (_indexPath.section == 2){
        //_titleLabel.text = @"合计";
        if (_indexPath.row == 0) {
            _titleLabel.text = @"使用卡券";
        }else if (_indexPath.row == 1){
            _titleLabel.text = @"合计";

        }
    }else if (_indexPath.section == 4){
        _titleLabel.text = @"订单编号";
    }
}

- (void)setModel:(QAllorderListModel *)model{
    _model = model;
    if(_indexPath.section == 0){
        if(_indexPath.row == 0){
            //_subTitleLabel.text = [NSString stringWithFormat:@"￥%@",_model.total];
            _subTitleLabel.text = @"服务未完成待结算";
        }else if (_indexPath.row == 1){
            _subTitleLabel.text = [NSString stringWithFormat:@"%@元/升",_model.oilPrice];
        }else if (_indexPath.row == 2){
            _subTitleLabel.text = _model.oilType;
        }else if (_indexPath.row == 3){
            _subTitleLabel.text = _model.serviceTime;
        }else if (_indexPath.row == 4){
            _subTitleLabel.text = [NSString stringWithFormat:@"%@",_model.address];
        }else if (_indexPath.row == 5){
            _subTitleLabel.text = [NSString stringWithFormat:@"%@",_model.tankerTel];
        }else if (_indexPath.row == 6){
            _subTitleLabel.text = @"否";
        }
    }else if (_indexPath.section == 2){
    
        if (_indexPath.row == 0) {
            if ([_model.couponRemark isEqualToString:@""]) {
                _subTitleLabel.text = @"未使用";
            }else{
                _subTitleLabel.text = _model.couponRemark;
            }
        }else if (_indexPath.row == 1){
            //_subTitleLabel.text = [NSString stringWithFormat:@"￥%@",_model.sum];
            _subTitleLabel.text = @"服务未完成待结算";
        }

    }else if (_indexPath.section == 4){
    
        _subTitleLabel.text = [NSString stringWithFormat:@"%@",_model.orderId];

    }
}



@end
